<template>
	<div class="school">
		<h2>我是School组件</h2>
		<h3>校名：{{name}}</h3>
	</div>
</template>

<script>
	export default {
		name:'School',
		data() {
			return {
				name:'尚硅谷'
			}
		},
		methods: {
			test(){
				console.log('test')
			}
		},
		mounted() {
			this.$bus.$on('xxx',this.test)
		}
	}
</script>

<style scoped>
	.school{
		background-color: skyblue;
		padding: 20px;
	}
</style>